//存储开发团队信息的js文件
var developerTeam = [
    {id: 1, name: "Mojang Studios", logo: "../img/mojang.png", description: "Minecraft的原始开发团队"},
    {id: 2, name: "Forge Modders", logo: "../img/forge.png", description: "专注于Minecraft Forge模组开发"},
    {id: 3, name: "Fabric Team", logo: "../img/fabric.png", description: "Fabric模组API的开发者"},
    {
        id: 4,
        name: "Roguelike Development",
        logo: "../img/roguelike.png",
        description: "专注于Roguelike风格的Minecraft模组"
    },
    {id: 5, name: "Mojang AB", logo: "../img/mojang.png", description: "Minecraft的母公司"}
];
let currentDeveloperTeam = null;

// 页面加载时显示所有开发团队信息
document.addEventListener('DOMContentLoaded', displayDeveloperTeam);

// 显示所有开发团队信息
function displayDeveloperTeam() {
    const developerTeamList = document.querySelector('#developerTeamList');
    developerTeamList.innerHTML = '';

    developerTeam.forEach(team => {
        const listItem = document.createElement('li');
        listItem.innerHTML = `
            <div class="developer-team-item">
                <img src="$team.logo" alt="$team.name" class="developer-team-logo">
                <div class="developer-team-info">
                    <h3>$team.name</h3>
                    <p>$team.description</p>
                </div>
                <button class="edit" onclick="editDeveloperTeam($team.id)">编辑</button>
                <button class="delete" onclick="openDeleteModal($team.id)">删除</button>
            </div>
        `;
        developerTeamList.appendChild(listItem);
    });
}

function displayWarnings(filteredWarnings = null) {
    const tableBody = document.querySelector('#warningTable tbody');
    tableBody.innerHTML = '';

    const dataToDisplay = filteredWarnings || warnings;

    if (dataToDisplay.length === 0) {
        const row = document.createElement('tr');
        row.innerHTML = `<td colspan="5" style="text-align: center;">没有找到警告</td>`;
        tableBody.appendChild(row);
        return;
    }

    dataToDisplay.forEach(warning => {
        const row = document.createElement('tr');
        row.innerHTML = `
                    <td>${warning.id}</td>
                    <td><img src="${warning.src}" alt="${warning.title}" style="width: 60px; height: 60px;" class="warning-image"></td>
                    <td>${warning.title}</td>
                    <td>${warning.content}</td>
                    <td><span class="status status-${warning.type}">${getTypeName(warning.type)}</span></td>
                    <td>
                        <button class="edit" onclick="editWarning(${warning.id})">编辑</button>
                        <button class="delete" onclick="openDeleteModal(${warning.id})">删除</button>
                    </td>
                `;
        tableBody.appendChild(row);
    });
}